OpenUA Joystick Configuration



Summary:

Unlike the original Urban Assault engine, which has an internal algorithm to automatically detect
and assign axis and button keys for joystick models by default, OpenUA uses SDL module to support
its joystick functionality.

The current implementation mechanism requires users to create custom configuration files to adjust
and assign correct key input schemes for individual joystick models.

Without the OpenUA joystick configuration file, the input schemes for joystick controls in OpenUA
will be usually misplaced or misconfigured into wrong axis and button mappings, which can be very
inconvenient and may also render them unusable.

In order to rectify this issue in OpenUA, check the following instruction for the solutions below.



Instruction:

1) Creating the joystick configuration file

The proper joystick set-up method for OpenUA requires creating a custom configuration file inside
the game's root (main) folder, with the file name 'joyconf.txt'. It should be an empty text file.

UPDATE: joyconf.txt is now included in the package by default. Look for the file in the directory.


Once joyconf.txt file is created in the game folder, it must contain the following information:

The GUID(s) of the connected joystick model(s), and input parameters that are required to manually
adjust or correct the key input schemes.



2) Finding the GUID numbers of the joystick models

There are multiple ways of finding the GUID(s) of the connected joystick models. You can skip this
part if you already know your joystick's GUID number. Joystick manuals can be helpful for the job.

If OpenUA was launched at least once after a joystick was connected to the machine, it will read
the technical information of the last detected joystick model and save it inside 'sdlInputLog.txt'
file that is located at ENV folder. Otherwise, the file will contain 'No joysticks found' message.

Inside the sdlInputLog.txt file there will be information about the joystick model, GUID, as well
as how many inputs are available on the joystick. Copy the GUID number and paste it into the newly
created joyconf.txt in the game folder, and then add one colon (:) at the end of the GUID number.



3) Assigning the correct axis and button key mappings

This is the tricky part as it requires knowing or determining which axis and button functions are
currently assigned to certain axes and buttons for the individual joystick models inside OpenUA.

It is more complicated by the fact that individual joystick models will inherently have different
initial key designs and settings. Therefore, it is impossible to describe a general solution here
since the details of the circumstances will be quite different across different joystick models.


The examples of syntax to correct the key mappings are as follows:

a1:3 - Axis 1 re-assigned as Axis 3
a2:1 - Axis 2 re-assigned as Axis 1
b3:4 - Button 3 re-assigned as Button 4
b9:1 - Button 9 re-assigned as Button 1


Figuring out which axes and buttons are being assigned in OpenUA relative to individual joystick
models may require some trial-and-error. It can be very helpful if you have an original joystick
manual or other reference materials available for the joystick.


The input parameters above should be continually added as necessary followed by the initial GUID
number (with spaces in-between). The final format of a line in joyconf.txt should look like this:

79000600000000000000504944564944: a1:3 a2:1 b3:4 b9:1


It is also possible to add support for multiple joysticks in the same way (add new lines to enter
extra information about multiple GUIDs and key input parameters for individual joystick models):

79000600000000000000504944564944: a1:3 a2:1 b3:4 b9:1
12345678901234567890123456789012: a2:4 a3:1 b7:5 b6:8
02147483648429496729685899345920: a1:2 a3:4 b5:6 b7:8 b9:10 b11:12


As mentioned above, each joystick model may require different settings and combinations to work.
So it is impossible to describe a general solution here. Once the work finished, save the joystick
config file and test the updated inputs inside OpenUA.



4) Quick-Fix Method

DISCLAIMER: This method is NOT universally applicable and verified! Keep in mind that individual
joystick models have different base designs, and so the following method is not guaranteed to work
for all joystick models.

Swapping the function numbers of Axis 2 with Axis 3 and Axis 3 with Axis 2 (a2:3 a3:2) appears to
resolve the most common key mapping mismatch issue for many joystick models. Whilst there is no
guarantee this method will work, it is still recommended as the first option to try.



Notes:

If you require any further assistance or technical support for issues in OpenUA, please join the
official UA community website or Discord server and open a support ticket.


Visit Urban Assault Community Website:
https://metropolisdawn.de


OpenUA is an open source engine re-implementation of the original Urban Assault engine that aims
to provide more stable support for playing UA on modern systems and hardware.